home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Xconq 7.0d37 / source / x11 / Makefile.in < prev    next >
Encoding:
Makefile  |  1995-05-05  |  4.6 KB  |  205 lines  |  [TEXT/R*ch]

  1. # Makefile for X11 interface to Xconq.
  2. # Copyright (C) 1991, 1992, 1993, 1994, 1995 Stanley T. Shebs.
  3.  
  4. # Xconq is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8.  
  9. # Where xconq itself lives.
  10.  
  11. prefix = .
  12.  
  13. exec_prefix = $(prefix)
  14. bindir = $(exec_prefix)
  15. # this should be tweaked
  16. libdir = $(srcdir)/../lib
  17. datadir = $(prefix)/lib
  18. mandir = $(prefix)/man
  19. man6dir = $(mandir)/man6
  20. infodir = $(prefix)/info
  21. docdir = $(datadir)/doc
  22.  
  23. srcdir = .
  24.  
  25. krnsrcdir = $(srcdir)/../kernel
  26.  
  27. # Set this for wherever the library directory should be.
  28.  
  29. LIBDIR = $(srcdir)/../lib
  30.  
  31. IMFLIBDIR = $(srcdir)/../lib-x11
  32.  
  33. SHELL = /bin/sh
  34.  
  35. INSTALL = `cd $(srcdir)/..;pwd`/install.sh -c
  36. INSTALL_PROGRAM = $(INSTALL)
  37. INSTALL_DATA = $(INSTALL)
  38.  
  39. CC = cc
  40.  
  41. CFLAGS = -g
  42.  
  43. # Ditto for X font libraries.
  44. #XFONTPATH = /usr/local/X11/lib/fonts/misc
  45.  
  46. X11_LIB = -lXmu -lX11
  47.  
  48. XAW_LIB = -L../SelFile -lXgnu -lXaw -lXt $(X11_LIB) -lXext -lm
  49.  
  50. # Override this in order to point at the Xpm include files.
  51.  
  52. XPM_INCLUDE_FLAGS =
  53.  
  54. # Override this in order to point at the Xpm library.
  55.  
  56. XPM_LIB = -lXpm
  57.  
  58. WITH_LIBS = 
  59.  
  60. # Host and target-dependent makefile fragments come in here.
  61. ####
  62. # End of host and target-dependent makefile fragments.
  63.  
  64. GAME_H = $(krnsrcdir)/game.h \
  65.      $(krnsrcdir)/gvar.def \
  66.      $(krnsrcdir)/utype.def \
  67.      $(krnsrcdir)/mtype.def \
  68.      $(krnsrcdir)/ttype.def \
  69.      $(krnsrcdir)/table.def
  70.  
  71. UNIT_H = $(krnsrcdir)/unit.h \
  72.      $(krnsrcdir)/action.def \
  73.      $(krnsrcdir)/plan.def \
  74.      $(krnsrcdir)/task.def
  75.  
  76. ALL_H = $(krnsrcdir)/conq.h \
  77.     $(krnsrcdir)/config.h \
  78.     $(krnsrcdir)/misc.h \
  79.     $(krnsrcdir)/dir.h \
  80.     $(krnsrcdir)/lisp.h \
  81.     $(krnsrcdir)/module.h \
  82.     $(GAME_H) \
  83.     $(krnsrcdir)/player.h \
  84.     $(krnsrcdir)/side.h \
  85.     $(UNIT_H) \
  86.     $(krnsrcdir)/goal.def \
  87.     $(krnsrcdir)/world.h \
  88.     $(krnsrcdir)/score.h \
  89.     $(krnsrcdir)/history.h \
  90.     $(krnsrcdir)/ai.h
  91.  
  92. X_H = $(srcdir)/xconq.h $(srcdir)/xcmd.def
  93.  
  94. # Interface-specific object files.
  95.  
  96. XOBJS =    xconq.o \
  97.     xinit.o \
  98.     xmap.o \
  99.     xdraw.o \
  100.     xcmd.o \
  101.     xprint.o \
  102.     xdesign.o \
  103.     xhelp.o \
  104.     ximf.o
  105.  
  106. XUTOBJS = ximf.o \
  107.      xutil.o
  108.  
  109. UNIX_CFLAGS = -DUNIX -DUSE_CONSOLE -DXCONQLIB=\"$(libdir)\" -DIMFLIB=\"$(IMFLIBDIR)\"
  110.  
  111. ALL_CFLAGS = $(CFLAGS) $(XPM_CFLAGS) $(REQD_CFLAGS) $(UNIX_CFLAGS) -I$(srcdir) -I$(krnsrcdir) $(X11_INCLUDE_FLAGS)
  112.  
  113. .c.o:
  114.     $(CC) -c $(ALL_CFLAGS) $<
  115.  
  116. # Do it all.
  117.  
  118. all:    xconq Xconq Xconq-co x2imf imf2x xshowimf XShowimf XShowimf-co
  119.  
  120. # The game itself.
  121.  
  122. xconq: $(XOBJS) ../kernel/libconq.a ../kernel/libconqlow.a
  123.     rm -f xconq
  124.     $(CC) -o xconq $(ALL_CFLAGS) $(XOBJS) ../kernel/libconq.a ../kernel/libconqlow.a $(X11_LIB_FLAGS) $(WITH_LIBS) $(XAW_LIB)
  125.  
  126. ../kernel/libconq.a:
  127.     (cd ../kernel; make libconq.a; cd ../x11)
  128.  
  129. ../kernel/libconqlow.a:
  130.     (cd ../kernel; make libconqlow.a; cd ../x11)
  131.  
  132. # X-related utilities.
  133.  
  134. x2imf:    x2imf.o $(XUTOBJS) ../kernel/libconqlow.a
  135.     $(CC) -o x2imf x2imf.o $(XUTOBJS) ../kernel/libconqlow.a $(ALL_CFLAGS) $(X11_LIB_FLAGS) $(WITH_LIBS) $(XAW_LIB)
  136.  
  137. imf2x:    imf2x.o $(XUTOBJS) ../kernel/libconqlow.a
  138.     $(CC) -o imf2x imf2x.o $(XUTOBJS) ../kernel/libconqlow.a $(ALL_CFLAGS) $(X11_LIB_FLAGS) $(WITH_LIBS) $(XAW_LIB)
  139.  
  140. xshowimf:    xshowimf.o $(XUTOBJS) ../kernel/libconqlow.a
  141.     $(CC) -o xshowimf xshowimf.o $(XUTOBJS) ../kernel/libconqlow.a $(ALL_CFLAGS) $(X11_LIB_FLAGS) $(WITH_LIBS) $(XAW_LIB)
  142.  
  143. # Resources.
  144.  
  145. Xconq:    Xconq.ad
  146.     cp $(srcdir)/Xconq.ad Xconq
  147.  
  148. Xconq-co:    Xconq-co.ad
  149.     cp $(srcdir)/Xconq-co.ad Xconq-co
  150.  
  151. XShowimf:    XShowimf.ad
  152.     cp $(srcdir)/XShowimf.ad XShowimf
  153.  
  154. XShowimf-co:    XShowimf-co.ad
  155.     cp $(srcdir)/XShowimf-co.ad XShowimf-co
  156.  
  157. # Installation requires programs in $(DESTDIR) and a library directory.
  158. # Also, fonts might have to go in system's font directory.
  159. # No standard place for formatted docs, you're on your own...
  160.  
  161.  
  162. install: all install-only
  163.  
  164. install-only:
  165.     $(INSTALL_PROGRAM) xconq $(bindir)
  166.     $(INSTALL_PROGRAM) imf2x $(bindir)
  167.     $(INSTALL_PROGRAM) x2imf $(bindir)
  168.     $(INSTALL_PROGRAM) xshowimf $(bindir)
  169.     $(INSTALL_DATA) $(srcdir)/xconq.6 $(man6dir)
  170.  
  171. # Font installation.
  172.  
  173. install-fonts:
  174.     echo will borrow from 5.5 when fonts are supported
  175.  
  176. # Cleanliness support.
  177.  
  178. clean:
  179.     rm -f *.o lint.out core
  180.     rm -f xconq *.conq *.xconq Xconq Xconq-co
  181.     rm -f imf2x x2imf xshowimf XShowimf XShowimf-co
  182.  
  183. distclean: clean
  184.     rm -f Makefile config.status
  185.  
  186. extraclean: distclean
  187.     rm -f *~* .*~*
  188.  
  189. realclean: distclean
  190.  
  191. Makefile: Makefile.in $(host_makefile_frag) $(target_makefile_frag)
  192.     $(SHELL) config.status
  193.  
  194. # Dependencies.
  195.  
  196. xconq.o:    $(ALL_H) $(X_H)
  197. xinit.o:    $(ALL_H) $(X_H)
  198. xmap.o:        $(ALL_H) $(X_H)
  199. xcmd.o:        $(ALL_H) $(X_H)
  200. xdraw.o:    $(ALL_H) $(X_H)
  201. xprint.o:    $(ALL_H) $(X_H)
  202. xdesign.o:    $(ALL_H) $(X_H)
  203. xhelp.o:    $(ALL_H) $(X_H)
  204. ximf.o:        $(ALL_H) $(X_H)
  205.